package com.collaboration.proton.services;

import com.collaboration.proton.dao.HeroRepository;
import com.collaboration.proton.entities.Hero;
import com.collaboration.proton.entities.UserHero;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author thousandcat
 * @param
 * @return 无
 *
 */
@Service
public class HeroService {
    @Autowired
    HeroRepository heroRepository;

    public List<Hero> getAll() {

        return heroRepository.findAll();
    }

    public void save(Hero hero) {
        heroRepository.save(hero);
    }

    public List<Hero> findAllByUserHero(UserHero userHero){
        return heroRepository.findAllByUserHero(userHero);
    }
}
